/*
 * 项目名称:    wms-server-jeecg
 * 创建人员:    FangYongliang
 * 创建时间:    2023-09-25
 */
package org.jeecg.modules.dock.entity.dto.response;

import lombok.Data;

/**
 * //TODO 【请填写类描述】
 *
 * @author FangYongliang
 * @version 1.0.0
 * @since 2023-09-25
 */
@Data
public class WmsResult {

    private String target;
    private String msg;
    private Integer errCode;
    private Object data ;

    public static WmsResult ok(){
        WmsResult result = new WmsResult();
        result.target = "success";
        result.msg = "成功";
        result.errCode = 200;
        return result;
    }
    public static WmsResult ok(Object data){
        WmsResult ok = ok();
        ok.data = data;
        return ok;
    }

    public static WmsResult error(){
        WmsResult result = new WmsResult();
        result.target = "error";
        result.msg = "失败";
        result.errCode = 400;
        return result;
    }

    public static WmsResult error(String msg){
        WmsResult error = error();
        error.msg = msg;
        return error;
    }
}
